﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:Cquery_ColumList三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class Cquery_ColumListService
	{
		 
	 
			
		public static int DeleteCquery_ColumListById(long id)	
		{     
            Cquery_ColumList cquery_ColumList = new Cquery_ColumList();
            cquery_ColumList.Id = id;
            EntityQuery<Cquery_ColumList> query = new EntityQuery<Cquery_ColumList>(cquery_ColumList);
             return query.Delete(cquery_ColumList);
		}	
        
          //以标识列获得对象
        public static Cquery_ColumList GetCquery_ColumListById(long  id)
        {
            Cquery_ColumList cquery_ColumList = new Cquery_ColumList();
            cquery_ColumList.Id = id;
            EntityQuery<Cquery_ColumList> query = new EntityQuery<Cquery_ColumList>(cquery_ColumList);
            query.FillEntity(cquery_ColumList);
            return cquery_ColumList;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateCquery_ColumList(Cquery_ColumList cquery_ColumList)
        {
            Cquery_ColumList _cquery_ColumList = new Cquery_ColumList();

            EntityQuery<Cquery_ColumList> query = new EntityQuery<Cquery_ColumList>(_cquery_ColumList);
           _cquery_ColumList= cquery_ColumList;
           int i=(cquery_ColumList.Id==0)?
                 query.Insert(_cquery_ColumList): query.Update(_cquery_ColumList);
            return i;
        }
		
		 
	}
}

